using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using Vit.CMS.Data;

namespace Vit.CMS.Controllers
{
    public class SiteController : Controller
    {
        public ActionResult Index()
        {
            List<string> sites = new List<string>();

            string sitePath = Server.MapPath("~/Sites");
            DirectoryInfo siteDir = new DirectoryInfo(sitePath);
            foreach (DirectoryInfo d in siteDir.GetDirectories())
            {
                if (d.Name.StartsWith("."))
                    continue;
                sites.Add(d.Name);
            }

            return PartialView(sites);
        }

        public ActionResult Edit(string id)
        {
            Session["ManageSite"] = id;
            ViewData.Model = id;
            return PartialView();
        }
    }
}
